{layout name="layout/sharewifi" /}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">分享设置</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">分享标题 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[title]" value="{$model['title']}" required>
                                </div>
                            </div>
                            <div class="am-form-group">
                    			<label class="am-u-sm-3 am-u-lg-2 am-form-label am-text-xs form-require">分享图片 </label>
                    			<div class="am-u-sm-9 am-u-end">
                    				<div class="am-form-file">
                    					<button type="button" class="upload-file am-btn am-btn-primary am-btn-xs am-radius">
                    						<i class="am-icon-cloud-upload"></i> 选择图片
                    					</button>
                    					<div class="uploader-list am-cf">
                    					    <div class="file-item"> 
                    					        <img src="{$model['image']}">            
                                                <input type="hidden" name="data[image]" value="{$model['image']}">
                                            </div>      
                    					</div>
                    				</div>
                    				<div class="help-block">
                                        <small>建议尺寸：宽500 高400，单位PX</small>
                                    </div>
                    			</div>
                    		</div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 图片文件列表模板 -->
{include file="../addons/upload/view/template/tpl_file_item_url.html" /}
<!-- 文件库弹窗 -->
{include file="../addons/upload/view/template/file_library.html" /}
<script>
    $(function () {
        
        // 选择图片
        $('.upload-file').selectImages({
            name: 'data[image]'
        });
        $('#my-form').formPost();

    });
</script>